
using UnityEngine;
using UnityGameFramework.Runtime;

namespace StarForce.Hotfix
{
    public static class HotfixEntityEx
    {
        /// <summary>
        /// 展示Tips消息框
        /// </summary>
        /// <param name="text"></param>
        public static void ShowTip(string text)
        {
            TipData tipData = new TipData(GameEntry.Entity.GenerateSerialId(), 1000, text);

            StarForce.HotfixEntityData data =
                new StarForce.HotfixEntityData(tipData.Id, tipData.TypeId, "Tip", tipData);

            if (text == "已断开连接")
            {
                return;
            }
            GameEntry.Entity.ShowHotfixEntity(Constant.AssetPriority.ImageAsset, data);
        }

        /// <summary>
        /// Loading 页面
        /// </summary>
        public static void ShowLoading()
        {
            int? id = GameEntry.UI.OpenUIForm((int) HotfixUIFormId.LoadingPage);
            // todo 记录请求次数
            //HotfixGameEntry.UserData.HttpCount += 1;
        }
    }
}